import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { GTextFormat } from "../../../common/GTextFormat";
import { BaseItem } from "../common/BaseItem";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ScaleBitmap } from "../../../../com/mui/display/ScaleBitmap";
type int = number;
//class KingBigGiftItemRenderer
    
    export  class KingBigGiftItemRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this._glowYellow = new Object /* flash.filters.GlowFilter */(16776960, 1, 3, 3, 5);
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            this._bg = ObjCreate.createBg(3, 0, 96, 100, this, ImagesConst.RechargeBottom);
            var loc1=new GTextFormat("", 12, null, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._nameBg = ObjCreate.createBg(11, 5, 84, 20, this, ImagesConst.FightingStrgBg);
            this._nameTxt = ObjCreate.createTextField("", 1, 7, 96, 20, this, loc1);
            this._itemBg = ObjCreate.createBg(19, 28, 65, 65, this, ImagesConst.PackItemBg);
            this._baseItem = new BaseItem();
            this._baseItem.move(21, 30);
            this._baseItem.setSize(60, 60);
            this._baseItem.isDragAble = false;
            this._baseItem.isDropAble = false;
            addChild(this._baseItem);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            this._itemCode = arg1.data as int;
            this._itemData = new ItemData(this._itemCode);
            this._baseItem.itemData = this._itemData;
            this._nameTxt.htmlText = HTMLUtil.addColor(this._itemData.itemInfo.item.name, "#ff9900");
            this._baseItem.isShowToolTip = false;
            return;
        }

        public /* override */ set selected(arg1: Boolean)
        {
            super.selected = arg1;
            if (arg1) 
            {
                this.setClickState(true);
            }
            else 
            {
                this.setClickState(false);
            }
            return;
        }

        public setClickState(arg1: Boolean): void
        {
            if (this._gradientGlow == null) 
            {
                this._gradientGlow = new Object /* flash.filters.GradientGlowFilter */();
                this._gradientGlow.distance = 0;
                this._gradientGlow.angle = 45;
                this._gradientGlow.colors = [16777062, 16776960];
                this._gradientGlow.alphas = [0, 1];
                this._gradientGlow.ratios = [0, 255];
                this._gradientGlow.blurX = 5;
                this._gradientGlow.blurY = 5;
                this._gradientGlow.strength = 2;
                this._gradientGlow.quality = flash.filters.BitmapFilterQuality.HIGH;
                this._gradientGlow.type = flash.filters.BitmapFilterType.OUTER;
            }
            if (arg1 && this._gradientGlow) 
            {
                this.filters = [this._gradientGlow];
            }
            else 
            {
                this.filters = [];
            }
            return;
        }

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_nameBg: ScaleBitmap;

        /* internal */ /* var */_nameTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_baseItem: BaseItem;

        /* internal */ /* var */_itemBg: ScaleBitmap;

        /* internal */ /* var */_itemCode: int;

        /* internal */ /* var */_itemData: ItemData;

        /* internal */ /* var */_glowYellow: Object /* flash.filters.GlowFilter */;

        /* internal */ /* var */_gradientGlow: Object /* flash.filters.GradientGlowFilter */;
    }
